package com.star.news.struct;

import com.star.news.dto.NewsSaveDTO;
import com.star.news.dto.NewsUpdateDTO;
import com.star.news.entity.News;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;

/**
 * @author lintianyi
 */
@Mapper
public interface NewsStruct {
    NewsStruct INSTANCE = Mappers.getMapper(NewsStruct.class);


    /**
     * to Role
     *
     * @param dto dto
     * @return {@link News}
     */
    News to(NewsSaveDTO dto);

    /**
     * to Role
     *
     * @param dto dto
     * @return {@link News}
     */
    News to(NewsUpdateDTO dto);

}
